Function Get-XmlString
{
    [CmdletBinding()]
    Param(
        [Parameter(Mandatory = $True)]
        $private:Object
    )
    
    Process
    {
        # Write object to in-memory XML string
        $private:StringWriter = New-Object System.IO.StringWriter
        $private:XmlTextWriter = New-Object System.Xml.XmlTextWriter $StringWriter
        $private:DataContractSerializer = New-Object System.Runtime.Serialization.DataContractSerializer ($Object.GetType())
        $DataContractSerializer.WriteObject($XmlTextWriter, $Object)
        Return $StringWriter.ToString()
    }
}

Export-ModuleMember Get-XmlString
